package jcl;

import java.util.HashSet;
import java.util.Set;

/**
 * @author yuisama
 * @date 2022/05/18 21:17
 **/
public class SetTest {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        System.out.println(set.add(1));
        System.out.println(set.add(1));
        System.out.println(set.add(2));
        System.out.println(set.add(3));
        System.out.println(set.contains(3));
        System.out.println(set.contains(4));
        System.out.println(set.remove(2));
        for (int i : set) {
            System.out.print(i + " ");
        }
    }
}